package com.bgq365.study.springboot2.boot01helloworld.controller;

import com.bgq365.study.springboot2.boot01helloworld.bean.Person;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class HelloController {

    @Autowired
    Person person;

    @GetMapping("hello")
    public String hello() {
        return "Hello World Spring Boot 2.4.1";
    }

    @GetMapping("person")
    public Person person(){
        log.info(person.toString());
        return person;
    }
}
